home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / catD / scsi_alloc.z / scsi_alloc
Encoding:
Text File  |  1998-10-30  |  4.7 KB  |  133 lines

  1.  
  2.  
  3.  
  4. ssssccccssssiiii____aaaalllllllloooocccc((((DDDD3333XXXX))))                                                ssssccccssssiiii____aaaalllllllloooocccc((((DDDD3333XXXX))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      scsi_alloc - allocate communication channel to host adapter driver
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ttttyyyyppppeeeessss....hhhh>>>>
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ssssccccssssiiii....hhhh>>>>
  14.  
  15.      iiiinnnntttt
  16.      ((((****ssssccccssssiiii____aaaalllllllloooocccc))))(((( vvvveeeerrrrtttteeeexxxx____hhhhddddllll____tttt _l_u_n__v_h_d_l,,,,
  17.                       iiiinnnntttt _o_p_t_i_o_n,,,,
  18.                       vvvvooooiiiidddd ((((****_c_a_l_l_b_a_c_k__f_u_n_c_t_i_o_n))))((((vvvveeeerrrrtttteeeexxxx____hhhhddddllll____tttt,,,, cccchhhhaaaarrrr ****))))))));;;;
  19.  
  20. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  21.      A kernel level SCSI device driver calls _s_c_s_i__a_l_l_o_c to initialize a
  22.      communication connection between itself and a host adapter driver, in
  23.      preparation for issuing SCSI commands.  The _l_u_n__v_h_d_l argument specifies
  24.      the hwgraph vertex for the device.  The _o_p_t_i_o_n argument currently has two
  25.      fields:
  26.  
  27.      +o   SCSIALLOC_EXCLUSIVE indicates that the driver needs exclusive use
  28.          with the device.
  29.  
  30.      +o   SCSIALLOC_QDEPTH is an 8-bit mask specifying the maximum number of
  31.          commands that the device driver will want to queue.  It is advisory
  32.          only and may be ignored by the host adapter driver.
  33.  
  34.      The _c_a_l_l_b_a_c_k__f_u_n_c_t_i_o_n may be useful for drivers that don't use the
  35.      SCSIALLOC_EXCLUSIVE option.  When _c_a_l_l_b_a_c_k__f_u_n_c_t_i_o_n is NULL, it is
  36.      ignored.  When non-NULL, it specifies a function to call whenever there
  37.      is sense data from device.  It can be useful when more than one device
  38.      driver will talk to a SCSI device, but one of the drivers needs to know
  39.      about things like media removals.  Only one device driver may specify a
  40.      callback_function for a given device.  The callback function is called
  41.      with two arguments, the vertex handle corresponding to the SCSI lun and
  42.      the sense data.  The vertex handle allows a driver to know which device
  43.      the callback pertains to.
  44.  
  45. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  46.      _s_c_s_i__a_l_l_o_c returns 0 if a communication connection could not be
  47.      established, or if the arguments are invalid, or if the device was
  48.      already allocated in exclusive use mode, or if this request was for
  49.      exclusive use and the device is already allocated (including possibly
  50.      earlier requests by the same driver).  Otherwise, it returns a positive
  51.      value.
  52.  
  53. NNNNOOOOTTTTEEEESSSS
  54.      _s_c_s_i__a_l_l_o_c is stored as a function pointer in the scsi_ctlr_info_t
  55.      structure, which is associated with the scsi host adapter vertex in the
  56.      hwgraph.  The information structure in the scsi target vertex also has a
  57.      pointer to the scsi_ctlr_info_t of the host adapter that the target is
  58.      connected to.  Given a _l_u_n__v_h_d_l (vertex handle of the device) the
  59.      _s_c_s_i__a_l_l_o_c function can be called as follows:
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ssssccccssssiiii____aaaalllllllloooocccc((((DDDD3333XXXX))))                                                ssssccccssssiiii____aaaalllllllloooocccc((((DDDD3333XXXX))))
  71.  
  72.  
  73.  
  74.               scsi_lun_info_t *scsi_lun_info;
  75.            ...
  76.               scsi_lun_info = scsi_lun_info_get(lun_vhdl);
  77.               SLI_ALLOC(scsi_lun_info)(lun_vhdl,option,callback_function);
  78.  
  79.  
  80. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  81.      comments in /usr/include/sys/scsi.h, hwgraph.intro(D4X), scsi_free(D3X),
  82.      scsi_info(D3X), scsi_command(D3X), scsi_ioctl(D3X), scsi_abort(D3X), SCSI
  83.      chapter of the IRIX Device Driver Programmer's Guide.
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.